/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ocumed.teams.teamb.gui;

import ocumed.teams.teamb.application.PatientReihung;

/**
 *
 * @author apr3455
 */
public class WarteschlangeOrd extends WarteschlangeModel {

    public WarteschlangeOrd(PatientReihung controller){
        super(controller);
    }
   
    public int getColumnCount() {
        return m_aerzteIds.size();
    }
    
    public void initColumn(){
        m_columnName = new String[m_aerzteIds.size()];
        m_columnName[0] = "Pos.";
    }
    
    public void initAerzte(){
        m_aerzteIds = m_controller.getAerzte();
        m_aerzteIds.add(0, -1);
    }
    
    protected String getArztName(int arztId){
        return m_controller.getArztName(m_aerzteIds.get(arztId));
    }
    
    protected Integer getSelectedPatient(Integer row, Integer col){
        return getPatientIdAt(row, col);
    }
    
    public Object getValueAt(int row, int col) {
        if(col == 0){
            return " " + String.valueOf(row + 1);
        } else {
            if(getPatientIdAt(row, col) != null){
                return m_patientNames.get(getPatientIdAt(row, col));
            }
        }
        return "";
    }

    @Override
    protected void setRowCount() {
    
        if(m_rowCount < m_patientListe.size()){
            m_rowCount = m_patientListe.size();
        }
    
    }

}
